package com.laxcen.basiclib.core.update.entity;


import com.alibaba.fastjson.annotation.JSONField;

/**
 * 提供的默认的标注返回api
 */
public class ApiResult<T> {
    public final static String CODE = "Code";
    public final static String MSG = "Msg";
    public final static String DATA = "Data";


    @JSONField(alternateNames = {"code"})
    private int Code;
    @JSONField(alternateNames = {"msg"})
    private String Msg;
    @JSONField(alternateNames = {"data"})
    private T Data;

    public int getCode() {
        return Code;
    }

    public ApiResult setCode(int code) {
        Code = code;
        return this;
    }

    public String getMsg() {
        return Msg;
    }

    public ApiResult setMsg(String msg) {
        Msg = msg;
        return this;
    }

    public T getData() {
        return Data;
    }

    public ApiResult setData(T data) {
        Data = data;
        return this;
    }

    @Override
    public String toString() {
        return "ApiResult{" +
                "Code='" + Code + '\'' +
                ", Msg='" + Msg + '\'' +
                ", Data=" + Data +
                '}';
    }
}
